package cn.hl.hm.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.hl.hm.dao.DriverOwnInfoMapper;
import cn.hl.hm.entity.DriverOwnInfo;
import cn.hl.hm.service.DriverOwnInfoService;
@Service
public class DriverOwnInfoServiceImpl implements DriverOwnInfoService {

	@Autowired
	private DriverOwnInfoMapper driverOwnInfoDao;
	
	/**
	 * 根据ID查询司机消息
	 */
	@Override
	public List<DriverOwnInfo> selectDriverOwnInfo(Integer driverId,Integer id,Integer pageCount) {
		DriverOwnInfo driverOwnInfo=new DriverOwnInfo();
		driverOwnInfo.setDriverId(driverId);
		driverOwnInfo.setId(id);
		driverOwnInfo.setPageCount(pageCount);
		return driverOwnInfoDao.selectDriverOwnInfo(driverOwnInfo);
	}

	@Override
	public int insertSelective(String info, int driverId) {
		DriverOwnInfo driverOwnInfo=new DriverOwnInfo();
		driverOwnInfo.setCreateTime(new Date());
		driverOwnInfo.setInfo(info);
		driverOwnInfo.setDriverId(driverId);
		
		return driverOwnInfoDao.insertSelective(driverOwnInfo);
	}

}
